<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>AdminLTE | SysRight</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <!-- font Awesome -->
    <link href="../static/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <!-- Ionicons -->
    <link href="../static/css/ionicons.min.css" rel="stylesheet" type="text/css"/>
    <!-- Theme style -->
    <link href="../static/css/AdminLTE.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="../static/css/right/common.css"/>
    <link rel="stylesheet" type="text/css" href="../static/css/right/slide.css"/>
    <link rel="stylesheet" type="text/css" href="../static/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="../static/css/right/flat-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../static/css/right/jquery.nouislider.css">

</head>
<body class="skin-blue" style="overflow: hidden">
<!-- header logo: style can be found in header.less -->
<header class="header">
    <a href="index.html" class="logo">
        <!-- Add the class icon to your logo image or logo icon to add the margining -->
        AdminLTE
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top" role="navigation">
        <!-- Sidebar toggle button-->
        <a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </a>
        <div class="navbar-right">
            <ul class="nav navbar-nav">
                <!-- User Account: style can be found in dropdown.less -->
                <li class="dropdown user user-menu">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <i class="glyphicon glyphicon-user"></i>
                        <span>个人中心<i class="caret"></i></span>
                    </a>
                    <ul class="dropdown-menu">
                        <!-- User image -->
                        <li class="user-header bg-light-blue">
                            <img src="../static/img/pers/rw1.png" class="img-circle" alt="User Image"/>
                            <p>
                                我
                            </p>
                        </li>
                        <!-- Menu Body -->
                        <li class="user-body">
                            <div class="col-xs-4 text-center">
                                <a href="/findManger">个人信息</a>
                            </div>
                            <div class="col-xs-4 text-center">
                                <a href="/findAllLogs">操作日志</a>
                            </div>
                            <div class="col-xs-4 text-center">
                                <a href="/login">退出登录</a>
                            </div>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </nav>
</header>
<div class="wrapper row-offcanvas row-offcanvas-left">
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="left-side sidebar-offcanvas">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
            <!-- Sidebar user panel -->
            <div class="user-panel">
                <div class="pull-left image">
                    <img src="../static/img/pers/rw1.png" class="img-circle" alt="User Image"/>
                </div>
                <div class="pull-left info">
                    <p>你好，管理员</p>

                    <a href="#"><i class="fa fa-circle text-success"></i> 在线</a>
                </div>
            </div>
            <!-- search form -->
            <form action="#" method="get" class="sidebar-form">
                <div class="input-group">
                    <input type="text" name="search" class="form-control" placeholder="搜索..."/>
                    <span class="input-group-btn">
                                <button type='submit' name='searchtoUrl' id='search-btn' class="btn btn-flat"><i
                                        class="fa fa-search"></i></button>
                            </span>
                </div>
            </form>
            <!-- /.search form -->
            <!-- sidebar menu: : style can be found in sidebar.less -->
            <ul class="sidebar-menu">
                <li>
                    <a href="index.html">
                        <i class="fa fa-dashboard"></i> <span>首页</span>
                    </a>
                </li>
                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-bar-chart-o"></i>
                        <span>日志管理</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                        <li><a href="/LogCatchPre"><i class="fa fa-angle-double-right"></i> 日志获取</a></li>
                        <li><a href="LogAnalysis.html"><i class="fa fa-angle-double-right"></i> 日志分析</a></li>
                        <li><a href="LogWarn.html"><i class="fa fa-angle-double-right"></i> 日志报警</a></li>
                    </ul>
                </li>
                <li class="treeview active">
                    <a href="#">
                        <i class="fa fa-table"></i> <span>系统管理</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                        <li class="active"><a href="SysRight.html"><i class="fa fa-angle-double-right" onclick="function getRightList() {
                            $.ajax(
                                    {
                                      type:'get',
                                      url:'/SysRightPre',
                                      date:{
                                      pageNum:0,
                                      pageSize:8
                                    },
                                     dataType:'json',
                                    }
                                  )
                            }
                        getRightList()"></i> 权限管理</a></li>
                        <li><a href="/PersRightPre"><i class="fa fa-angle-double-right"></i> 人员管理</a></li>
                    </ul>
                </li>
                <li>
                    <a href="calendar.html">
                        <i class="fa fa-calendar"></i> <span>日历</span>

                    </a>
                </li>
                <li>
                    <a href="/findAllMailsInBox">
                        <i class="fa fa-envelope"></i> <span>邮箱</span>

                    </a>
                </li>
            </ul>
        </section>
        <!-- /.sidebar -->
    </aside>
    <!-- Right side column. Contains the navbar and content of the page -->
    <aside class="right-side">
        <!-- Main content -->
        <section class="content">
            <!-- 权限管理模块 -->
            <div role="tabpanel" class="tab-pane" id="char">
                <section class="content-header no-margin">
                    <h1 class="text-center">
                        权限管理
                    </h1>
                </section>
                <div class="table-responsive" th:if="${allRightsList}!=null">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>用户名</th>
                            <th>用户类型</th>
                            <th>邮件权限</th>
                            <th>日志权限</th>
                            <th>权限管理权限</th>
                            <th>用户管理权限</th>
                            <th>日历备忘录权限</th>
                        </tr>
                        </thead>
                        <tbody>
                        <!--th:if="${allRightsList.isPersRightEdit} eq 1"-->
                        <tr th:each="allRightsList:${allRightsList}">
                            <td th:text="${allRightsList.id}"></td>
                            <td th:text="${allRightsList.managerType}"></td>
                            <td th:text="${allRightsList.isMailEdit}">0</td>
                            <td th:text="${allRightsList.isLogEdit}">0</td>
                            <td th:text="${allRightsList.isRightEdit}">0</td>
                            <td th:text="${allRightsList.isPersRightEdit}">0</td>
                            <td th:text="${allRightsList.isCalendarEdit}">0</td>
                            <td>
                                <button class="btn btn-success btn-xs" data-toggle="modal"
                                        data-target="#UpdateRight" th:onclick="UpdateRight([[${allRightsList.id}]])">修改
                                </button>
                            </td>
                            <!--th:onclick="'javascript:updM('+${managerList.id}+')'"
                            th:onclick="'javascript:delM('+${managerList.id}+')'"-->
                        </tr>
                        </tbody>
                    </table>
                    <div class="modal-footer no-margin-top">
                        <ul class="pagination pull-right no-margin">
                            <!-- 首页 -->
                            <li>
                                <a th:href="'/SysRightPre?pageNum=0'"
                                   style="font-weight: bold;background-color: #6faed9;">首页</a>
                            </li>
                            <!-- 上一页 -->
                            <li th:if="${allRightsList.hasPrevious()}">
                                <a th:href="'/SysRightPre?pageNum=' + ${allRightsList.previousPageable().getPageNumber()}"
                                   th:text="上一页" style="font-weight: bold;background-color: #6faed9;"></a>
                            </li>
                            <!-- 中间页 -->
                            <li th:each="pageNum:${#numbers.sequence(0, allRightsList.getTotalPages() - 1)}">
                                <a th:href="'/SysRightPre?pageNum=' + ${pageNum}" th:text="${pageNum + 1}"
                                   th:if="${pageNum ne allRightsList.pageable.getPageNumber()}"
                                   style="font-weight: bold;background-color: #6faed9;"></a>
                                <a th:href="'/SysRightPre?pageNum=' + ${pageNum}" th:text="${pageNum + 1}"
                                   th:if="${pageNum eq allRightsList.pageable.getPageNumber()}"
                                   th:style="'font-weight:bold;background: #6faed9;'"></a>
                            </li>
                            <!-- 下一页 -->
                            <li th:if="${allRightsList.hasNext()}">
                                <a th:href="'/SysRightPre?pageNum=' + ${allRightsList.nextPageable().getPageNumber()}"
                                   th:text="下一页" style="font-weight: bold;background-color: #6faed9;"></a>
                            </li>
                            <!-- 尾页 -->
                            <li>
                                <a th:href="'/SysRightPre?pageNum=' + ${allRightsList.getTotalPages() - 1}"
                                   style="font-weight: bold;background-color: #6faed9;">尾页</a>
                            </li>
                        </ul>
                    </div>
                </div>


            </div>

        </section><!-- /.content -->
    </aside><!-- /.right-side -->
</div><!-- ./wrapper -->
<!-- /.modal -->
<!--修改权限弹出窗口-->
<div class="modal fade" id="UpdateRight" role="dialog" aria-labelledby="gridSystemModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="gridSystemModalLabel">修改权限(请谨慎修改！)</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <form class="form-horizontal" action="" method="post" id="updateform" onsubmit="getUrl()">
                        <div class="form-group ">
                            <label class="col-xs-3 control-label">用户名：</label>
                            <div class="col-xs-8 ">
                                <input type="text" class="form-control input-sm duiqi" id="Name" name="Name"
                                       value="" readonly="true"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">邮件权限：</label>
                            <div class="col-xs-6 ">
                                <select class=" form-control select-duiqi" id="mailRight" name="mailRight">
                                    <option value="0">0</option>
                                    <option value="1">1</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">日志权限：</label>
                            <div class="col-xs-6 ">
                                <select class=" form-control select-duiqi" id="logRight" name="logRight">
                                    <option value="0">0</option>
                                    <option value="1">1</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">权限管理权限：</label>
                            <div class="col-xs-6 ">
                                <select class=" form-control select-duiqi" id="sysRight" name="sysRight">
                                    <option value="0">0</option>
                                    <option value="1">1</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">用户管理权限：</label>
                            <div class="col-xs-6 ">
                                <select class=" form-control select-duiqi" id="persRight" name="persRight">
                                    <option value="0">0</option>
                                    <option value="1">1</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-3 control-label">日历备忘录权限：</label>
                            <div class="col-xs-6 ">
                                <select class=" form-control select-duiqi" id="calRight" name="calRight">
                                    <option value="0">0</option>
                                    <option value="1">1</option>
                                </select>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-xs btn-white" data-dismiss="modal">取 消</button>
                            <button type="submit" class="btn btn-xs btn-green">保 存</button>
                        </div>
                    </form>
                </div>
                <!-- /.modal-content -->
            </div>
            <!-- /.modal-dialog -->
        </div>
    </div>
</div>
<!-- /.modal -->
<!-- /.modal -->

<!-- jQuery 2.0.2 -->
<script src="../static/js/right/jquery.min.js"></script>

<script src="../static/js/jquery-ui-1.10.3.min.js" type="text/javascript"></script>
<!-- Bootstrap -->
<script src="../static/js/bootstrap.min.js" type="text/javascript"></script>
<!-- AdminLTE App -->
<script src="../static/js/AdminLTE/app.js" type="text/javascript"></script>
<script src="../static/js/right/jquery.nouislider.js" type="text/javascript"></script>
<script type="text/javascript">
    function UpdateRight(ID) {
        $("#Name").val(ID);
    }

    function getUrl() {
        const myurl = '/updateRight?id=' + $("#Name").val();
        $("#updateform").attr("action", myurl);
    }
</script>
<!--<script type="text/javascript">
    $(document).ready(function () {
        if ([[${session?.iur}]] == true) {
            alert("修改成功")
        }
    });
</script>-->
</body>
</html>